import request from '@/utils/request'

// 获取权限列表
export function permission(params) {
  return request({
    url: '/permissions',
    params
  })
}

// 获取权限数量
export function permissionCount() {
  return request({
    url: '/permissions/count'
  })
}

// 删除
export function delPermission(id) {
  return request({
    url: '/permissions/' + id,
    method: 'delete'
  })
}

// 新增权限
export function addPermission(data) {
  return request({
    url: '/permissions',
    method: 'post',
    data
  })
}

// 获取指定权限

export function perPermission(id) {
  return request({
    url: '/permissions/' + id
  })
}

// 编辑
export function editPermission(data) {
  return request({
    url: '/permissions/' + data.id,
    method: 'put',
    data
  })
}
